package wxb.avalon.core.service;

import wxb.avalon.core.bean.Result;
import wxb.avalon.core.entity.GamePlayerRole;
import wxb.avalon.core.entity.Room;
import com.baomidou.mybatisplus.extension.service.IService;
import wxb.avalon.core.entity.dto.RoomPlayerDto;
import wxb.avalon.core.entity.vo.RoomRoleVo;

import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author wxb
 * @since 2022-01-11
 */
public interface IRoomService extends IService<Room> {

    //建房
    Room create(RoomRoleVo vo);

    //加入房间
    Result<List<RoomPlayerDto>> join(String roomNo, Integer playerId);

    //获取房间玩家
    List<RoomPlayerDto> getRoomPlayers(String roomNo);

    //退出房间
    List<RoomPlayerDto> quit(String roomNo, Integer playerId);

    //获取房间
    Room getByRoomNo(String roomNo);

    //开始游戏
    void createGame(String roomNo, Integer playerId);

    void allotRoles(List<GamePlayerRole> list);
}
